/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package expressions;

import OpenCOM.*;

/**
 *
 * @author Tinoo
 */
public abstract class BaseOperator extends OpenCOMComponent implements IExpression, IMetaInterface, IUnknown
{
    protected OCM_MultiReceptacle<IExpression> m_operands;
    
    public BaseOperator(IUnknown x)
    {
        super(x);
        m_operands = new OCM_MultiReceptacle<IExpression>(IExpression.class);
    }

    // IConnections Interface
    public boolean connect(IUnknown pSink, String riid, long ConnID)
    {
        if(riid.toString().equalsIgnoreCase("Samples.AdderComponent.IAdd"))
            return m_operands.connectToRecp(pSink, riid, ConnID);
        return false;
    }

    public boolean disconnect(String riid, long connID)
    {
        if(riid.toString().equalsIgnoreCase("Samples.AdderComponent.IAdd"))
            return m_operands.disconnectFromRecp(connID);

        return false;
    }
}
